package cn.vshare.service;

import cn.vshare.entity.Comment;
import cn.vshare.entity.User;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;

import java.util.Map;


/**
 * @Auther: 张恒
 * @Date: 2018/9/17 11:56
 * @Description:commen业务层
 */
public interface CommentService {

    PageInfo<Comment> queryAllComment(String videoId, Integer pageNum, Integer pageSize);

    PageInfo<Comment> queryAllCommentByParseCount(String videoId, Integer pageNum, Integer pageSize);

    Comment addComment(User user, String videoId, String context, String date);

    boolean updateCommentParseCount(String commentId, Integer parseCount);

    boolean updateCommentAuditStatus(String commentId, Integer auditStatus);

    boolean updateCommentByInform(String commentId);

    boolean delComment(String commentId);

    boolean updateCommentStatus(String commentId, Integer status);

    /**
     * 根据条件获取评论
     * @param map
     * @return
     * @author penghaixin
     */
    Page<Comment> getCommentList(Map<String, Object> map);

    /**
     * 删除评论
     * @param id
     * @author penghaixin
     */
    void delCommentById(String id);

    Integer queryCommentCount(String videoId);

    int queryCommentIfLike(String commentId, User user);

    Comment queryCommentById(String commentId);

    boolean updateCommentAddLike(User user, String commentId) throws Exception;

    boolean updateCommentCancelLike(User user, String commentId) throws Exception;


}
